<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<div id="box1">
		{{n+2}}<br>
		{{c}}<br>
		{{msg}}<br>
		<button @click="fan()">反转</button>
		{{fan()}}
	</div>








	<script src="js/vue.js"></script>
	<script type="text/javascript">
		var app1 = new Vue({
			el:"#box1",
			data:{//数据
				n:2,
				msg:"西安好地方"
			},
			methods:{//方法
				fan:function(){
				  return this.msg.split("").reverse().join("")
				}
			},
			computed:{
				c:function(){
					return this.n+4;
				},
				
			}
		})
		methods
		computed
	</script>
</body>
</html>